package cn.lger.util;

import cn.lger.pojo.Page;

/**
 * Code that Changed the World
 *
 * @author Pro
 * @date 2018-06-16.
 */
public class PageUtil {

    private PageUtil() {
    }

    public static <T> Page<T> generator(Integer page, Integer size) {
        Page<T> pageInstance = new Page<>();
        pageInstance.setPage(page != null && page > 0 ? page : 1);
        pageInstance.setSize(size != null && size > 0 ? size : 3);
        return pageInstance;
    }

}
